package com.itheima.controller;

import com.itheima.domain.count.ClazzStudentCountVo;
import com.itheima.domain.vo.*;
import com.itheima.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/** Statistics-数据统计
 * @author 上官徵羽
 * @version 1.0
 * @since 2025-08-25 9:36
 */
@RestController
@RequestMapping("/report")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    /** 员工性别统计 */
    @GetMapping("/empJobData")
    public Result getStudentReport(){
        JobVo jobVo = statisticsService.getEmpJobData();
        return Result.success(jobVo);
    }

    /** 员工性别统计 */
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<EmpGenderVo> empGenderVos = statisticsService.getEmpGenderData();
        return Result.success(empGenderVos);
    }


    /** 学生学历统计 */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<StudentDegreeVo> studentDegreeVos = statisticsService.getStudentDegreeData();
        return Result.success(studentDegreeVos);
    }

    /** 班级学生数量统计 */
    @GetMapping("/studentCountData")
    public Result getClazzNumberData(){
        ClazzStudentCountVo clazzStudentCountVo = statisticsService.getClazzStudentCountData();
        return Result.success(clazzStudentCountVo);
    }
}